3.12 \(\int (a+b x)^2 \sin (c+d x) \, dx\)

Optimal. Leaf size=50 \[ \frac {2 b (a+b x) \sin (c+d x)}{d^2}-\frac {(a+b x)^2 \cos (c+d x)}{d}+\frac {2 b^2 \cos (c+d x)}{d^3} \]

[Out]

2*b^2*cos(d*x+c)/d^3-(b*x+a)^2*cos(d*x+c)/d+2*b*(b*x+a)*sin(d*x+c)/d^2

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3296, 2638} \[ \frac {2 b (a+b x) \sin (c+d x)}{d^2}-\frac {(a+b x)^2 \cos (c+d x)}{d}+\frac {2 b^2 \cos (c+d x)}{d^3} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*x)^2*Sin[c + d*x],x]

[Out]

(2*b^2*Cos[c + d*x])/d^3 - ((a + b*x)^2*Cos[c + d*x])/d + (2*b*(a + b*x)*Sin[c + d*x])/d^2

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3296

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> -Simp[((c + d*x)^m*Cos[e + f*x])/f, x] +
Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps

\begin {align*} \int (a+b x)^2 \sin (c+d x) \, dx &=-\frac {(a+b x)^2 \cos (c+d x)}{d}+\frac {(2 b) \int (a+b x) \cos (c+d x) \, dx}{d}\\ &=-\frac {(a+b x)^2 \cos (c+d x)}{d}+\frac {2 b (a+b x) \sin (c+d x)}{d^2}-\frac {\left (2 b^2\right ) \int \sin (c+d x) \, dx}{d^2}\\ &=\frac {2 b^2 \cos (c+d x)}{d^3}-\frac {(a+b x)^2 \cos (c+d x)}{d}+\frac {2 b (a+b x) \sin (c+d x)}{d^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.18, size = 57, normalized size = 1.14 \[ \frac {2 b d (a+b x) \sin (c+d x)-\left (a^2 d^2+2 a b d^2 x+b^2 \left (d^2 x^2-2\right )\right ) \cos (c+d x)}{d^3} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x)^2*Sin[c + d*x],x]

[Out]

(-((a^2*d^2 + 2*a*b*d^2*x + b^2*(-2 + d^2*x^2))*Cos[c + d*x]) + 2*b*d*(a + b*x)*Sin[c + d*x])/d^3

________________________________________________________________________________________

fricas [A]  time = 0.61, size = 63, normalized size = 1.26 \[ -\frac {{\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right ) - 2 \, {\left (b^{2} d x + a b d\right )} \sin \left (d x + c\right )}{d^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*sin(d*x+c),x, algorithm="fricas")

[Out]

-((b^2*d^2*x^2 + 2*a*b*d^2*x + a^2*d^2 - 2*b^2)*cos(d*x + c) - 2*(b^2*d*x + a*b*d)*sin(d*x + c))/d^3

________________________________________________________________________________________

giac [A]  time = 0.57, size = 65, normalized size = 1.30 \[ -\frac {{\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )}{d^{3}} + \frac {2 \, {\left (b^{2} d x + a b d\right )} \sin \left (d x + c\right )}{d^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*sin(d*x+c),x, algorithm="giac")

[Out]

-(b^2*d^2*x^2 + 2*a*b*d^2*x + a^2*d^2 - 2*b^2)*cos(d*x + c)/d^3 + 2*(b^2*d*x + a*b*d)*sin(d*x + c)/d^3

________________________________________________________________________________________

maple [B]  time = 0.02, size = 148, normalized size = 2.96 \[ \frac {\frac {b^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}+\frac {2 a b \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )}{d}-\frac {2 b^{2} c \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{2}}-a^{2} \cos \left (d x +c \right )+\frac {2 a b c \cos \left (d x +c \right )}{d}-\frac {b^{2} c^{2} \cos \left (d x +c \right )}{d^{2}}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^2*sin(d*x+c),x)

[Out]

1/d*(1/d^2*b^2*(-(d*x+c)^2*cos(d*x+c)+2*cos(d*x+c)+2*(d*x+c)*sin(d*x+c))+2/d*a*b*(sin(d*x+c)-(d*x+c)*cos(d*x+c
))-2/d^2*b^2*c*(sin(d*x+c)-(d*x+c)*cos(d*x+c))-a^2*cos(d*x+c)+2/d*a*b*c*cos(d*x+c)-1/d^2*b^2*c^2*cos(d*x+c))

________________________________________________________________________________________

maxima [B]  time = 0.95, size = 141, normalized size = 2.82 \[ -\frac {a^{2} \cos \left (d x + c\right ) + \frac {b^{2} c^{2} \cos \left (d x + c\right )}{d^{2}} - \frac {2 \, a b c \cos \left (d x + c\right )}{d} - \frac {2 \, {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} b^{2} c}{d^{2}} + \frac {2 \, {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} a b}{d} + \frac {{\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} b^{2}}{d^{2}}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*sin(d*x+c),x, algorithm="maxima")

[Out]

-(a^2*cos(d*x + c) + b^2*c^2*cos(d*x + c)/d^2 - 2*a*b*c*cos(d*x + c)/d - 2*((d*x + c)*cos(d*x + c) - sin(d*x +
 c))*b^2*c/d^2 + 2*((d*x + c)*cos(d*x + c) - sin(d*x + c))*a*b/d + (((d*x + c)^2 - 2)*cos(d*x + c) - 2*(d*x +
c)*sin(d*x + c))*b^2/d^2)/d

________________________________________________________________________________________

mupad [B]  time = 4.70, size = 84, normalized size = 1.68 \[ \frac {\cos \left (c+d\,x\right )\,\left (2\,b^2-a^2\,d^2\right )}{d^3}-\frac {b^2\,x^2\,\cos \left (c+d\,x\right )}{d}+\frac {2\,a\,b\,\sin \left (c+d\,x\right )}{d^2}+\frac {2\,b^2\,x\,\sin \left (c+d\,x\right )}{d^2}-\frac {2\,a\,b\,x\,\cos \left (c+d\,x\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(c + d*x)*(a + b*x)^2,x)

[Out]

(cos(c + d*x)*(2*b^2 - a^2*d^2))/d^3 - (b^2*x^2*cos(c + d*x))/d + (2*a*b*sin(c + d*x))/d^2 + (2*b^2*x*sin(c +
d*x))/d^2 - (2*a*b*x*cos(c + d*x))/d

________________________________________________________________________________________

sympy [A]  time = 0.72, size = 112, normalized size = 2.24 \[ \begin {cases} - \frac {a^{2} \cos {\left (c + d x \right )}}{d} - \frac {2 a b x \cos {\left (c + d x \right )}}{d} + \frac {2 a b \sin {\left (c + d x \right )}}{d^{2}} - \frac {b^{2} x^{2} \cos {\left (c + d x \right )}}{d} + \frac {2 b^{2} x \sin {\left (c + d x \right )}}{d^{2}} + \frac {2 b^{2} \cos {\left (c + d x \right )}}{d^{3}} & \text {for}\: d \neq 0 \\\left (a^{2} x + a b x^{2} + \frac {b^{2} x^{3}}{3}\right ) \sin {\relax (c )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**2*sin(d*x+c),x)

[Out]

Piecewise((-a**2*cos(c + d*x)/d - 2*a*b*x*cos(c + d*x)/d + 2*a*b*sin(c + d*x)/d**2 - b**2*x**2*cos(c + d*x)/d
+ 2*b**2*x*sin(c + d*x)/d**2 + 2*b**2*cos(c + d*x)/d**3, Ne(d, 0)), ((a**2*x + a*b*x**2 + b**2*x**3/3)*sin(c),
 True))

________________________________________________________________________________________